package jpa.entitys.promis.sales;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the XFR_OF_OWNERSHIP database table.
 * 
 */
@Embeddable
public class XfrOfOwnershipPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private String company;

	@Column(name="TYPE_OF_CONTRACT")
	private String typeOfContract;

	@Column(name="CONTRACT_SERIES")
	private String contractSeries;

	@Column(name="CONTRACT_NUMBER")
	private long contractNumber;

	@Column(name="REVISION_NUMBER")
	private long revisionNumber;

    public XfrOfOwnershipPK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getTypeOfContract() {
		return this.typeOfContract;
	}
	public void setTypeOfContract(String typeOfContract) {
		this.typeOfContract = typeOfContract;
	}
	public String getContractSeries() {
		return this.contractSeries;
	}
	public void setContractSeries(String contractSeries) {
		this.contractSeries = contractSeries;
	}
	public long getContractNumber() {
		return this.contractNumber;
	}
	public void setContractNumber(long contractNumber) {
		this.contractNumber = contractNumber;
	}
	public long getRevisionNumber() {
		return this.revisionNumber;
	}
	public void setRevisionNumber(long revisionNumber) {
		this.revisionNumber = revisionNumber;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof XfrOfOwnershipPK)) {
			return false;
		}
		XfrOfOwnershipPK castOther = (XfrOfOwnershipPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.typeOfContract.equals(castOther.typeOfContract)
			&& this.contractSeries.equals(castOther.contractSeries)
			&& (this.contractNumber == castOther.contractNumber)
			&& (this.revisionNumber == castOther.revisionNumber);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.typeOfContract.hashCode();
		hash = hash * prime + this.contractSeries.hashCode();
		hash = hash * prime + ((int) (this.contractNumber ^ (this.contractNumber >>> 32)));
		hash = hash * prime + ((int) (this.revisionNumber ^ (this.revisionNumber >>> 32)));
		
		return hash;
    }
}